<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src='../js/vue.js'></script>
    <style>
        *{
            margin:0;
            padding: 0;
        }
        button{
            margin-top: 100px;
            width: 400px;
            height: 50px;
        }
        .cur{
            width: 400px;
            height: 200px;
            background: yellowgreen;
        }
    </style>
</head>
<body>
    <div id="app">
      
        <h1 v-if=" 1 + 1 ">今天是2022年3月28日,再过几天就四月份了</h1>
        <hr>
        <button @click="handle">让盒子进行显示与隐藏的切换</button>
        <div class="cur" v-if="show"></div>
    </div>
</body>
</html>
<script>
     //关联VM
     const VM = new Vue({
         el:'#app',
        
         data:{
             
             show:true
         },
         //实例的方法
         methods: {
            handle(){
               
               this.show = !this.show;
            }
         }
     });

    

    


</script>